<template>
  <rx-layout>
    <div slot="center" style>
      <rx-fit>
        <div slot="toolheader" foldheader="true" foldbtn="false" border="false">
          <div class="table-operator">

          </div>
          <span class="search-btn-box">
                <span class="search-btn" @click="searchshow"><i class="iconfont iconguolv"></i>{{$ti18('rxList.leachBtn','过滤')}}</span>
           </span>
        </div>
        <div slot="searchbar" btnalign="right"  v-if="fitSearch" @search="search" @cancel="cancel" @close="close">
          <a-form layout="vertical">
                <a-form-item :label="i18n('form.threadName','线程名称')">
                    <a-input :placeholder="i18n('form.threadName','线程名称','input')" v-model="queryParam.Q_threadName_S_LK"/>
                </a-form-item>
                <a-form-item :label="i18n('form.appName','应用模块')">
                    <a-input :placeholder="i18n('form.appName','应用模块','input')" v-model="queryParam.Q_appName_S_LK"/>
                </a-form-item>
                <a-form-item :label="i18n('form.loggerName','日志对象名称')">
                    <a-input :placeholder="i18n('form.loggerName','日志对象名称','input')" v-model="queryParam.Q_loggerName_S_LK"/>
                </a-form-item>
                <a-form-item :label="i18n('form.level','日志级别')">
                    <a-input :placeholder="i18n('form.level','日志级别','input')" v-model="queryParam.Q_level_S_LK"/>
                </a-form-item>
                <a-form-item :label="i18n('form.logMsg','日志信息')">
                    <a-input :placeholder="i18n('form.logMsg','日志信息','input')" v-model="queryParam.Q_formattedMessage_S_LK"/>
                </a-form-item>
                <a-form-item :label="i18n('form.operator','操作人')">
                    <a-input :placeholder="i18n('form.operator','操作人','input')" v-model="queryParam.Q_createBy_S_LK"/>
                </a-form-item>

                <a-form-item :label="$ti18('rxForm.createTime','创建时间')">
                    <a-range-picker format="YYYY-MM-DD HH:mm:ss" @change="onChange" allowClear>

                    </a-range-picker>
                </a-form-item>


          </a-form>
        </div>
        <rx-grid
                ref="table"
                :allowRowSelect="true"
                :multiSelect="true"
                :columns="columns"
                :defaultPageSize="10"
                url="/api-system/system/core/sysEsLog/query"
                :queryParam="queryParam"
                data-field="result.data"
                :pageSizeOptions="['10','30','40']"
                id-field="id"
                @selectChange="onSelectChange"
        >

        </rx-grid>
      </rx-fit>
    </div>
  </rx-layout>
</template>

<script>
  import {BaseList,RxFit,RxGrid } from "@lowcode/jpaas-common-lib";

  export default {
    name: 'SysEsLogList',
    mixins: [BaseList],
    components: {
      RxFit
    },
    data() {
      return {
        columns: [
          {
            title: this.$ti18('rxList.index','序号'),
            type: 'indexColumn',
            width: 60,
            dataIndex: 'serial',
            scopedSlots: {customRender: 'serial'}
          },
          {title: this.i18n('form.threadName','线程名称'), dataIndex: 'threadName', width: 100},
          {title: this.i18n('form.appName','应用模块'), dataIndex: 'appName', width: 90},
          {title: this.i18n('form.loggerName','日志对象名称'), dataIndex: 'loggerName', width: 100},
          {title: this.i18n('form.level','日志级别'), dataIndex: 'level', width: 50},
          {title: this.i18n('form.logMsg','日志信息'), dataIndex: 'formattedMessage', width: 200},
          {title: this.i18n('form.operator','操作人'), dataIndex: 'createBy', width: 70},
          {title: this.$ti18('rxForm.createTime','创建时间'), dataIndex: 'createTime', width: 100,sorter: true, sortField: 'createTime',}

        ],
        comment:this.i18n('list.comment','es日志'),
        widthHeight:['800px','600px'],
        apps:[]
      }
    },
    methods:{
      i18n(name,text,key){
            return this.$ti18(name,text,"SysEsLog",key);
      },
      onChange(date,dateStr){
          this.$set(this.queryParam,"Q_createTime_S_GE",dateStr[0]);
          this.$set(this.queryParam,"Q_createTime_S_LE",dateStr[1]);
      }

    }
  }
</script>
<style scoped>

</style>

